<%@page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="/include/head.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑用户</title>
<script type="text/javascript">
$(document).ready(function(){
	initView("${action}", null);
});
</script>
<%--<script type="text/javascript" src="js/label/jquery.js"></script>--%>
<link href="js/label/css/lanrenzhijia.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/label/lanrenzhijia.js"></script>
</head>
<body>

	
	<form id="form" enctype="multipart/form-data" onsubmit="return iframeCallback(this,closeCurrent);" action="activity/editActivity.do?funId=${funId}" method="post" >
    	<div class="pageContent"  layoutH="35">
			<div class="tabs">
				<div class="tabsHeader">
					<div class="tabsHeaderContent">
						<ul>
							<li><a><span>活动基础信息</span></a></li>
							<li><a><span>相关信息</span></a></li>
							<li><a><span>活动介绍</span></a></li>
							<li><a href="common/dsRelationListDiv.do?ACTION=${ACTION}&TODO=${TODO}&entityType_I=Activity&entityId_I=${object.id}" class="j-ajax"><span>导师团队</span></a></li>
							<li><a href="common/guestRelationListDiv.do?ACTION=${ACTION}&TODO=${TODO}&entityType_I=Activity&entityId_I=${object.id}" class="j-ajax"><span>自邀嘉宾</span></a></li>
							<li><a href="common/livePlayer.do?id=${object.id}" class="j-ajax"><span>直播测试</span></a></li>
							<c:if test="${todo=='manager'}">
							<li><a><span>现场管理</span></a></li>
							</c:if>
							<c:if test="${todo=='manager'}">
							<li><a><span>档案管理</span></a></li>
							</c:if>
							<c:if test="${todo=='evaluate'}">
							<li><a><span>活动评价</span></a></li>
							</c:if>
						</ul>
					</div>
				</div>
				<div class="tabsContent"  layoutH="74">
				
				<div class="pageFormContent">   
				        <fieldset class="2_ fieldset"> 
				            <dl class="nowrap">
					        	<dt>活动名称：</dt>
							    <dd>
							    	<input class="required textInput valid" type="text" alt="" value="${object.activityName }" size="30" name="activityName"/>
					            	<input type="hidden" name="id" value="${object.id }"/>
					            </dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>承办方：</dt>
							    <dd>
							    <dd>
								<input type="hidden" id="adminUserId" name="adminUserId" value="${object.adminUserId}"/>
								<input type="hidden" id="adminUserId2" name="adminUserId2" value="${object.adminUserId2}"/>
								<c:if test="${USER.userType=='CyzjEmp'}">
								<input type="hidden" name="orgId" id="orgId" value="${cyzjEmp.orgId}"/>
								<input class="required textInput valid" type="text" alt="" value="${cyzjEmp.dwName}" size="30" id="orgName" name="dwName" readonly></input>
								</c:if>
								<c:if test="${USER.userType!='CyzjEmp'}">
							    <input type="hidden" name="orgId" id="orgId" value="${object.orgId}"/>
							    <input class="required textInput valid" type="text" alt="" value="${object.dwName}" size="30" id="orgName" name="dwName"></input>
								</c:if>
								</dd>
							</dl>
				            <%--<dl class="nowrap">--%>
					        	<%--<dt>专管员：</dt>--%>
							    <%--<dd>--%>
							    	<%--<select name="adminUserId"  class="required">--%>
										<%--<option value=""></option>--%>
									<%--<c:forEach items="${Dict.getList('ZdzxEmp')}"  var="item" varStatus="varStatus">--%>
										<%--<option value="${item.KEY}"  ${object.adminUserId==item.KEY?'selected':''}>${item.VALUE}</option>--%>
							    	<%--</c:forEach>--%>
							    	<%--</select>--%>
							    <%--</dd>--%>
							<%--</dl>--%>
				            <dl class="nowrap">
					        	<dt>活动开始时间：</dt>
							    <dd><input class="required date valid" type="text" datefmt="yyyy-MM-dd HH:mm:ss" readonly value='<fmt:formatDate value="${object.beginTime}" type="both" pattern="yyyy-MM-dd HH:mm:ss" />' size="30" name="beginTime"/></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>活动结束时间：</dt>
							    <dd><input class="required date valid" type="text" datefmt="yyyy-MM-dd HH:mm:ss" readonly value='<fmt:formatDate value="${object.endTime}" type="both" pattern="yyyy-MM-dd HH:mm:ss" />' size="30" name="endTime"/></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>活动类型：</dt>
							    <dd>
							    	<select name="activityType"  class="required">
										<option value=""></option>
									<c:forEach items="${Dict.getList('ACTIVITY_TYPE')}"  var="item" varStatus="varStatus">
										<option value="${item.KEY}"  ${object.activityType==item.KEY?'selected':''}>${item.VALUE}</option>
							    	</c:forEach>
							    	</select>
					            </dd>
							</dl>
				            
				            <dl class="nowrap">
					        	<dt>是否公开：</dt>
							    <dd>
							    	<select name="isOpen"  class="required">
										<option value="1"  ${object.activityType=='1'?'selected':''}>是</option>
										<option value="0"  ${object.activityType=='0'?'selected':''}>否</option>
							    	</select>
					            </dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>所属行政区：</dt>
							    <dd>
							    	<select name="areaId"  class="required" id="areaId">
										<option value=""></option>
									<c:if test="${USER.userType!='CyzjEmp'}">
										<c:forEach items="${Dict.getList('AREA')}"  var="item" varStatus="varStatus">
											<option value="${item.KEY}"  ${object.areaId==item.KEY?'selected':''}>${item.VALUE}</option>
										</c:forEach>
									</c:if>
									<c:if test="${USER.userType=='CyzjEmp'}">
										<c:forEach items="${Dict.getList('AREA')}"  var="item" varStatus="varStatus">
											<option value="${item.KEY}"  ${cyzjOrg.areaId==item.KEY?'selected':''}>${item.VALUE}</option>
										</c:forEach>
									</c:if>
							    	</select>
							    </dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>活动地址：</dt>
					        	<dd>
								<c:if test="${USER.userType!='CyzjEmp'}">
							    	<input class="textInput required valid" type="text" alt="" value="${object.address }" size="30" name="address" id="address"></input>
								</c:if>
								<c:if test="${USER.userType=='CyzjEmp'}">
									<input class="textInput required valid" type="text" alt="" value="${cyzjOrg.address }" size="30" name="address" id="address"></input>
								</c:if>
								
								</dd>
							</dl>
							
				            <dl class="nowrap">
					        	<dt>经纬度：</dt>
							    <dd>
							    	<input class="textInput valid" type="text" readonly size="13" id="xxxx" name="x" value="${cyzjOrg.x}" >
									<input class="textInput valid" type="text" readonly size="13" id="yyyy" name="y" value="${cyzjOrg.y}" >
								<c:if test="${ACTION=='ADD' or ACTION=='MODIFY' or TODO=='EDIT' }">
									<a style="color: blue;" id="toSetMapPoint">选择位置</a>
									<a href="cyzj/theMap.do" target="dialog" max="true" lookupgroup="lookupOrg" style="color: blue;" id="setMapPoint"></a>
								</c:if>
									
								<c:if test="${object.x!=null and ACTION=='VIEW'}">
								<a href="cyzj/toTheMap.do?x=${object.x}&y=${object.y}" style="color: blue;" target="dialog" max="true" lookupgroup="lookupOrg">查看地图</a>
								</c:if>
							    </dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>计划参与人数：</dt>
							    <dd><input class="required number textInput valid" type="text" alt="" value="${object.planCnt }" size="30" name="planCnt"></input></dd>
							</dl>
							
				            <dl class="nowrap">
					        	<dt>联系人：</dt>
							    <dd><input class="textInput valid" type="text" alt="" value="${object.contact }" size="30" name="contact"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>电话：</dt>
							    <dd><input class="textInput valid" type="text" alt="" value="${object.tel }" size="30" name="tel"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>邮箱：</dt>
							    <dd><input class="textInput valid" type="text" alt="" value="${object.email }" size="30" name="email"></input></dd>
							</dl>
							
				            <dl class="nowrap">
					        	<dt>主办单位：</dt>
							    <dd><textarea name="zbdw" cols="70" rows="4" maxlength="200">${object.zbdw}</textarea></dd>
							</dl>
							
				            <dl class="nowrap">
					        	<dt>协办单位：</dt>
							    <dd><textarea name="xbdw" cols="70" rows="4" maxlength="200">${object.xbdw}</textarea></input></dd>
							</dl>
							
				            <dl class="nowrap">
					        	<dt>指导单位：</dt>
							    <dd>
							    <textarea name="zddw" cols="70" rows="4" maxlength="200">${object.zddw}</textarea></dd>
							</dl>
							
				            <dl class="nowrap">
					        	<dt>媒体支持：</dt>
							    <dd>
							    <textarea name="mtzc" cols="70" rows="4" maxlength="200">${object.mtzc}</textarea></dd>
							</dl>
							
				            <dl class="nowrap">
					        	<dt>备注：</dt>
					        	<dd><textarea name="remark" cols="100" rows="8" maxlength="500">${object.remark}</textarea></dd>
					        </dl>
						</fieldset>
					</div>
				
					<div class="pageFormContent">   
				        <fieldset class="2_ fieldset"> 
				        
				            
				            <dl class="nowrap">
					        	<dt>主图片<br>(建议800*450)：</dt>
					        	<dd>
									<div class="unit">
										<div class="upload-wrap">
											<div class="thumbnail">
											<img src="${Dict.prefix('UPLOAD')}${object.mainPicUrl}" data-width="0" data-height="0" width="80">
											</div>
											
										<c:if test="${ACTION!='VIEW'}">
											<input type="file" name="mainPic" accept="image/*" class="required">
										</c:if>
										</div>
									</div>
								</dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>活动海报<br>(建议800*450)：</dt>
					        	<dd> 
					        		<div class="unit">
										<ul id="upload-preview" class="upload-preview">
											<input type="hidden" id="delPicIds" name="delPicIds"/>
											<c:forEach items="${poster}" var="pic">
												<li class="oldPic thumbnail" style="padding-bottom:22px">
													<img src="${Dict.prefix('UPLOAD')}${pic.filePath}" data-width="0" data-height="0" width="80">
													
												<c:if test="${ACTION!='VIEW'}">
													<div data-id="${pic.id}" onclick="javascript:document.getElementById('delPicIds').value+=this.getAttribute('data-id')+',';this.parentNode.parentNode.removeChild(this.parentNode);">
														<a href="javascript:;">删除</a>
													</div>
												</c:if>
												</li>
											</c:forEach>
										</ul>
										
									<c:if test="${ACTION!='VIEW'}">
										<div class="upload-wrap" rel="#upload-preview">
											<input type="file" name="posterFile" accept="image/*" multiple="multiple">
										</div>
									</c:if>
									</div>
								</dd>
							</dl>
				        
				            <dl class="nowrap">
					        	<dt>活动标签：</dt>
							    <dd>
								    <div class="plus-tag">
										<c:forEach items="${activityTagList}" var="main">
											<a value="activityTag" title="${main.label}" href="javascript:void(0);"><span>${main.label}</span><em data-id="${main.id}"></em></a>
										</c:forEach>
									</div><br>
									
								<c:if test="${ACTION!='VIEW'}">
								    <input class="textInput valid" type="text" alt="" size="30" name="activityTagText"/>
									<a href="javascript:void(0)" data-id="activityTagText" class="plus-tag-add">添加标签</a>
									<input type="hidden" size="30" name="activityTag"  id="activityTag"/>

									<div class="default-tag tagbtn">
										<div class="clearfix">
											<c:forEach items="${allActivityTagList}" var="label">
												<a value="activityTag" title="${label.label}" href="javascript:void(0);"><span>${label.label}</span><em></em></a>
											</c:forEach>
										</div>
									</div>
								</c:if>
								</dd>
							</dl>
				        
						</fieldset>
					</div>
				

				
					<div class="pageFormContent">   
				        <fieldset class="2_ fieldset"> 
				           
				            <dl class="nowrap">
					        	<dt>活动导语：</dt>
					        	<dd><textarea placeholder="请输入活动导语，不超过500字"  name="activityDy" cols="120" rows="2" maxlength="500">${object.activityDy}</textarea></dd>
					        </dl>
				            <dl class="nowrap">
					        	<dt>活动简介：</dt>
					        	<dd><textarea placeholder="请输入活动简介，不超过3000字"  name="activityDesc" cols="120" rows="4" maxlength="3000">${object.activityDesc}</textarea></dd>
					        </dl>
				            <dl class="nowrap">
					        	<dt>参加对象：</dt>
					        	<dd><textarea placeholder="请输入活动参与对象说明，不超过100字"  name="attendObj" cols="120" rows="2" maxlength="100">${object.attendObj}</textarea></dd>
					        </dl>
						</fieldset>
					</div>
					
					<div>  
							相关导师				
					</div>
					
					<div>   
				        	自邀嘉宾
					</div>
					<div>   
					</div>
				<c:if test="${todo=='manager'}">
					<div class="pageFormContent"> 
				        <fieldset class="2_ fieldset"> 
				            <dl class="nowrap">
					        	<dt>直播地址：</dt>
							    <dd><input class="textInput valid" type="text" alt="" value="" size="30" name="videoUrl"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>计划参与人数：</dt>
							    <dd><input class="required number textInput valid" type="text" alt="" value="${object.planCnt }" size="30" name="planCnt"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>报名人数：</dt>
							    <dd><input class="required number textInput valid" type="text" alt="" value="${object.registedCnt }" size="30" name="registedCnt"></input></dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>签到人数：</dt>
							    <dd><input class="required number textInput valid" type="text" alt="" value="${object.checkinCnt }" size="30" name="checkinCnt"></input></dd>
							</dl>
						</fieldset>
					</div>
				</c:if>
				<c:if test="${todo=='manager2'}">
					<div class="pageFormContent"> 
				        <fieldset class="2_ fieldset"> 
				        
				            
				            <dl class="nowrap">
					        	<dt>导师签到表：</dt>
					        	<dd>
									<div class="unit">
										<div class="upload-wrap">
											<div class="thumbnail"></div>
											<input type="file" name="mainPic" accept="image/*">
										</div>
									</div>
								</dd>
							</dl>
				            <dl class="nowrap">
					        	<dt>活动现场照片<br>(建议800*450)：</dt>
					        	<dd> 
					        		<div class="unit">
										<ul id="upload-preview" class="upload-preview"></ul>
										<div class="upload-wrap" rel="#upload-preview">
											<input type="file" name="posterFile" accept="image/*" multiple="multiple">
										</div>
									</div>
								</dd>
							</dl>
				        
				            <dl class="nowrap">
					        	<dt>活动总结：</dt>
							    <dd>
							    
								</dd>
							</dl>
				        
						</fieldset>
					</div> 
				</c:if>
				<c:if test="${todo=='evaluate'}">
					<div class="pageFormContent">
				活动评价
					</div>
				</c:if>
			</div>
			<div class="tabsFooter">
				<div class="tabsFooterContent"></div>
			</div>
		</div>
	</div>
				
    <div class="formBar">
         <ul>
			
		
        	<li>
        		<input type="hidden" id="approveStatus" name="approveStatus" value=""/>
           		<input type="hidden" id="ACTION" name="ACTION" value="${ACTION }"/>
           		<input type="hidden" id="TODO" name="TODO" value="${TODO }"/>
           	</li>
            <li class="EDIT" style="display:none"><div class="button"><div class="buttonContent"><button type="submit" onclick="initSubmit('UNSUBMIT')">保存</button></div></div></li>
            <li class="EDIT" style="display:none"><div class="button"><div class="buttonContent"><button type="submit" onclick="initSubmit('SUBMITED')">保存并提交</button></div></div></li>
             	<li class="UPDATE" style="display:none"><div class="button"><div class="buttonContent"><button type="submit" onclick="initSubmit('${object.approveStatus}')">保存</button></div></div></li>
           	<li class="APPROVE" style="display:none">审核意见：<input id="approveDesc" class="textInput valid approveObj" type="text" alt="" size="30" name="approveDesc"></input></li>
           	<li class="APPROVE" style="display:none"><div class="button"><div class="buttonContent"><button type="submit" onclick="initSubmit('APPROVED')">审核通过</button></div></div></li>
            <li class="APPROVE" style="display:none"><div class="button"><div class="buttonContent"><button type="submit" onclick="initSubmit('REJECTED')">审核驳回</button></div></div></li>
			
			
			
			<li class="fieldCtrl" style="display:none"><div class="button"><div class="buttonContent"><button type="submit" onclick="initSubmit('fieldCtrl')">保存活动现场信息</button></div></div></li>
			<li class="fileMgr" style="display:none"><div class="button"><div class="buttonContent"><button type="submit" onclick="initSubmit('fileMgr')">保存活动档案</button></div></div></li>
			<li class="evaluateMgr" style="display:none"><div class="button"><div class="buttonContent"><button type="submit" onclick="initSubmit('evaluateMgr')">保存评价信息</button></div></div></li>
			
			
			<li> <div class="button"><div class="buttonContent"><button class="close" type="button">取消</button></div></div></li>
		</ul>
    </div>
</form>

</body>
	<script type="text/javascript">
	
	$(document).ready(function(){
		
		initView("${ACTION}","${TODO}","${readyMsg}");
		
		 
		setOrg = function (event, ui) {
	        if (ui != null && ui.item != null) { 
	            $("#orgId",navTab.getCurrentPanel()).val(ui.item.id);
				$("#address",navTab.getCurrentPanel()).val(ui.item.address);
				$("#adminUserId",navTab.getCurrentPanel()).val(ui.item.adminUserId);
				$("#adminUserId2",navTab.getCurrentPanel()).val(ui.item.adminUserId2);
				$("#xxxx",navTab.getCurrentPanel()).val(ui.item.x);
				$("#yyyy",navTab.getCurrentPanel()).val(ui.item.y);
				$("#areaId > option").each(function(){
					if($(this).val()==ui.item.areaId){
						$(this).attr("selected","selected");
					}
				})
	        } 
	    };
	    
		$("#orgName",navTab.getCurrentPanel()).autocomplete({
			source: getCyzjOrg,
			minLength:2,
			select: setOrg
		}); 
		
		$("#toSetMapPoint").click(function(){
			$("#setMapPoint").attr("href","cyzj/toTheMap.do?address="+$("#address").val());
			$("#setMapPoint").click();
		});
		
	});
	initLabel = function(){
		var activityTag = "";
		$(".plus-tag a").each(function(){
			var labelType = $(this).attr("value");
			var label = $(this).attr("title");
			if("activityTagText"==labelType){
				activityTag = activityTag+ "," + label;
			}
		})
		$('#activityTag',navTab.getCurrentPanel()).val(activityTag);
	};
	
	initSubmit = function(approveStatus){
		$('#approveStatus',navTab.getCurrentPanel()).val(approveStatus);
		
		if(approveStatus=='UNSUBMIT'){
			$('#TODO',navTab.getCurrentPanel()).val("EDIT");
			initLabel(); 
		}else if(approveStatus=='SUBMITED'){
			$('#TODO',navTab.getCurrentPanel()).val("SUBMIT");
			initLabel();
		}else if(approveStatus=='APPROVED'){
			$('#TODO',navTab.getCurrentPanel()).val("APPROVE");
			return isConfirm('是否确认审核通过？');			
		}else if(approveStatus=='REJECTED'){
			$('#TODO',navTab.getCurrentPanel()).val("APPROVE");
			return isConfirm('是否确认审核驳回？');
		}
		
	}


</script>
</html>
